#include <srts/stratego.h>
#include <stratego-lib/stratego-lib.h>
void init_constructors (void)
{
}
static Symbol sym__3;
static Symbol sym__2;
static Symbol sym_Nil_0;
static Symbol sym_None_0;
static Symbol sym_IntConst_1;
static Symbol sym_Declaration2_2;
static Symbol sym_Id_1;
static Symbol sym_IdDecl_3;
static Symbol sym_PostIncr_1;
static Symbol sym_PostDecr_1;
static Symbol sym_PreIncr_1;
static Symbol sym_PreDecr_1;
static Symbol sym_Negation_1;
static Symbol sym_IfExp_3;
static Symbol sym_Assign_3;
static Symbol sym_AssignEq_0;
static Symbol sym_AssignMul_0;
static Symbol sym_AssignDiv_0;
static Symbol sym_AssignMod_0;
static Symbol sym_AssignAnd_0;
static Symbol sym_Compound_2;
static Symbol sym_Stat_1;
static Symbol sym_If_2;
static Symbol sym_IfElse_3;
static Symbol sym_While_2;
static Symbol sym_DoWhile_2;
static Symbol sym_For_4;
static Symbol sym_Int_0;
static Symbol sym_DeclInit_2;
static Symbol sym_ArrayInit_1;
static Symbol sym_AssignInit_1;
static Symbol sym_TypeSpec_3;
static Symbol sym_Cons_2;
static Symbol sym_CodeConst_1;
static void init_module_constructors (void)
{
sym__3 = ATmakeSymbol("", 3, ATfalse);
ATprotectSymbol(sym__3);
sym__2 = ATmakeSymbol("", 2, ATfalse);
ATprotectSymbol(sym__2);
sym_Nil_0 = ATmakeSymbol("Nil", 0, ATfalse);
ATprotectSymbol(sym_Nil_0);
sym_None_0 = ATmakeSymbol("None", 0, ATfalse);
ATprotectSymbol(sym_None_0);
sym_IntConst_1 = ATmakeSymbol("IntConst", 1, ATfalse);
ATprotectSymbol(sym_IntConst_1);
sym_Declaration2_2 = ATmakeSymbol("Declaration2", 2, ATfalse);
ATprotectSymbol(sym_Declaration2_2);
sym_Id_1 = ATmakeSymbol("Id", 1, ATfalse);
ATprotectSymbol(sym_Id_1);
sym_IdDecl_3 = ATmakeSymbol("IdDecl", 3, ATfalse);
ATprotectSymbol(sym_IdDecl_3);
sym_PostIncr_1 = ATmakeSymbol("PostIncr", 1, ATfalse);
ATprotectSymbol(sym_PostIncr_1);
sym_PostDecr_1 = ATmakeSymbol("PostDecr", 1, ATfalse);
ATprotectSymbol(sym_PostDecr_1);
sym_PreIncr_1 = ATmakeSymbol("PreIncr", 1, ATfalse);
ATprotectSymbol(sym_PreIncr_1);
sym_PreDecr_1 = ATmakeSymbol("PreDecr", 1, ATfalse);
ATprotectSymbol(sym_PreDecr_1);
sym_Negation_1 = ATmakeSymbol("Negation", 1, ATfalse);
ATprotectSymbol(sym_Negation_1);
sym_IfExp_3 = ATmakeSymbol("IfExp", 3, ATfalse);
ATprotectSymbol(sym_IfExp_3);
sym_Assign_3 = ATmakeSymbol("Assign", 3, ATfalse);
ATprotectSymbol(sym_Assign_3);
sym_AssignEq_0 = ATmakeSymbol("AssignEq", 0, ATfalse);
ATprotectSymbol(sym_AssignEq_0);
sym_AssignMul_0 = ATmakeSymbol("AssignMul", 0, ATfalse);
ATprotectSymbol(sym_AssignMul_0);
sym_AssignDiv_0 = ATmakeSymbol("AssignDiv", 0, ATfalse);
ATprotectSymbol(sym_AssignDiv_0);
sym_AssignMod_0 = ATmakeSymbol("AssignMod", 0, ATfalse);
ATprotectSymbol(sym_AssignMod_0);
sym_AssignAnd_0 = ATmakeSymbol("AssignAnd", 0, ATfalse);
ATprotectSymbol(sym_AssignAnd_0);
sym_Compound_2 = ATmakeSymbol("Compound", 2, ATfalse);
ATprotectSymbol(sym_Compound_2);
sym_Stat_1 = ATmakeSymbol("Stat", 1, ATfalse);
ATprotectSymbol(sym_Stat_1);
sym_If_2 = ATmakeSymbol("If", 2, ATfalse);
ATprotectSymbol(sym_If_2);
sym_IfElse_3 = ATmakeSymbol("IfElse", 3, ATfalse);
ATprotectSymbol(sym_IfElse_3);
sym_While_2 = ATmakeSymbol("While", 2, ATfalse);
ATprotectSymbol(sym_While_2);
sym_DoWhile_2 = ATmakeSymbol("DoWhile", 2, ATfalse);
ATprotectSymbol(sym_DoWhile_2);
sym_For_4 = ATmakeSymbol("For", 4, ATfalse);
ATprotectSymbol(sym_For_4);
sym_Int_0 = ATmakeSymbol("Int", 0, ATfalse);
ATprotectSymbol(sym_Int_0);
sym_DeclInit_2 = ATmakeSymbol("DeclInit", 2, ATfalse);
ATprotectSymbol(sym_DeclInit_2);
sym_ArrayInit_1 = ATmakeSymbol("ArrayInit", 1, ATfalse);
ATprotectSymbol(sym_ArrayInit_1);
sym_AssignInit_1 = ATmakeSymbol("AssignInit", 1, ATfalse);
ATprotectSymbol(sym_AssignInit_1);
sym_TypeSpec_3 = ATmakeSymbol("TypeSpec", 3, ATfalse);
ATprotectSymbol(sym_TypeSpec_3);
sym_Cons_2 = ATmakeSymbol("Cons", 2, ATfalse);
ATprotectSymbol(sym_Cons_2);
sym_CodeConst_1 = ATmakeSymbol("CodeConst", 1, ATfalse);
ATprotectSymbol(sym_CodeConst_1);
}
static ATerm term33;
static ATerm term32;
static ATerm term31;
static ATerm term30;
static ATerm term29;
static ATerm term28;
static ATerm term27;
static ATerm term26;
static ATerm term25;
static ATerm term24;
static ATerm term23;
static ATerm term22;
static ATerm term21;
static ATerm term20;
static ATerm term19;
static ATerm term18;
static ATerm term17;
static ATerm term16;
static ATerm term15;
static ATerm term14;
static ATerm term13;
static ATerm term12;
static ATerm term11;
static ATerm term10;
static ATerm term9;
static ATerm term8;
static ATerm term7;
static ATerm term6;
static ATerm term5;
static ATerm term4;
static ATerm term3;
static ATerm term2;
static ATerm term1;
static ATerm term0;
static void init_module_constant_terms (void)
{
ATprotect(&(term0));
term0 = (ATerm) ATmakeAppl(ATmakeSymbol("symbols", 0, ATtrue));
ATprotect(&(term1));
term1 = term0;
ATprotect(&(term2));
term2 = (ATerm) ATmakeAppl(ATmakeSymbol("local", 0, ATtrue));
ATprotect(&(term3));
term3 = term2;
ATprotect(&(term4));
term4 = (ATerm) ATmakeAppl(ATmakeSymbol("_flag", 0, ATtrue));
ATprotect(&(term5));
term5 = term4;
ATprotect(&(term6));
term6 = (ATerm) ATmakeAppl(sym_Int_0);
ATprotect(&(term7));
term7 = term6;
ATprotect(&(term8));
term8 = (ATerm) ATmakeAppl(sym_TypeSpec_3, (ATerm)ATempty, term7, (ATerm) ATempty);
ATprotect(&(term9));
term9 = term8;
ATprotect(&(term10));
term10 = (ATerm) ATmakeAppl(sym_None_0);
ATprotect(&(term11));
term11 = term10;
ATprotect(&(term12));
term12 = (ATerm) ATmakeAppl(ATmakeSymbol("0", 0, ATtrue));
ATprotect(&(term13));
term13 = term12;
ATprotect(&(term14));
term14 = (ATerm) ATmakeAppl(sym_IntConst_1, term13);
ATprotect(&(term15));
term15 = term14;
ATprotect(&(term16));
term16 = (ATerm) ATmakeAppl(sym_AssignEq_0);
ATprotect(&(term17));
term17 = term16;
ATprotect(&(term18));
term18 = (ATerm) ATmakeAppl(sym_AssignDiv_0);
ATprotect(&(term19));
term19 = term18;
ATprotect(&(term20));
term20 = (ATerm) ATmakeAppl(sym_AssignMul_0);
ATprotect(&(term21));
term21 = term20;
ATprotect(&(term22));
term22 = (ATerm) ATmakeAppl(ATmakeSymbol("1", 0, ATtrue));
ATprotect(&(term23));
term23 = term22;
ATprotect(&(term24));
term24 = (ATerm) ATmakeAppl(sym_IntConst_1, term23);
ATprotect(&(term25));
term25 = term24;
ATprotect(&(term26));
term26 = (ATerm) ATmakeAppl(sym_AssignAnd_0);
ATprotect(&(term27));
term27 = term26;
ATprotect(&(term28));
term28 = (ATerm) ATmakeAppl(sym_AssignMod_0);
ATprotect(&(term29));
term29 = term28;
ATprotect(&(term30));
term30 = (ATerm) ATmakeAppl(ATmakeSymbol("4294967295", 0, ATtrue));
ATprotect(&(term31));
term31 = term30;
ATprotect(&(term32));
term32 = (ATerm) ATmakeAppl(sym_IntConst_1, term31);
ATprotect(&(term33));
term33 = term32;
}
#include <srts/init-stratego-application.h>
extern const char * __tracing_table [];
extern unsigned short __tracing_table_counter;
ATerm table_keys_0_0 (StrSL sl, ATerm t);
ATerm table_get_0_0 (StrSL sl, ATerm t);
ATerm table_put_0_0 (StrSL sl, ATerm t);
ATerm table_create_0_0 (StrSL sl, ATerm t);
ATerm fetch_elem_1_0 (StrSL sl, StrCL i_87, ATerm t);
ATerm elem_0_0 (StrSL sl, ATerm t);
ATerm map_1_0 (StrSL sl, StrCL z_86, ATerm t);
ATerm try_1_0 (StrSL sl, StrCL y_61, ATerm t);
ATerm bottomup_1_0 (StrSL sl, StrCL o_54, ATerm t);
ATerm env_alltd_1_0 (StrSL sl, StrCL o_52, ATerm t);
ATerm newname_0_0 (StrSL sl, ATerm t);
ATerm io_wrap_1_0 (StrSL sl, StrCL n_45, ATerm t);
ATerm Predicate_0_0 (StrSL sl, ATerm t);
ATerm IfConversion_0_0 (StrSL sl, ATerm t);
static ATerm lifted19 (StrSL sl, ATerm t);
static ATerm lifted20 (StrSL sl, ATerm t);
ATerm if_conversion_0_0 (StrSL sl, ATerm t);
ATerm main_0_0 (StrSL sl, ATerm t);
ATerm MakeLocal_0_0 (StrSL sl, ATerm t);
static ATerm lifted16 (StrSL sl, ATerm t);
static ATerm lifted14 (StrSL sl, ATerm t);
static ATerm lifted12 (StrSL sl, ATerm t);
static ATerm lifted10 (StrSL sl, ATerm t);
static ATerm lifted8 (StrSL sl, ATerm t);
static ATerm lifted6 (StrSL sl, ATerm t);
static ATerm lifted4 (StrSL sl, ATerm t);
ATerm AnalyseLocality_0_0 (StrSL sl, ATerm t);
ATerm AnalyseLocality_p__0_0 (StrSL sl, ATerm t);
ATerm is_local_0_0 (StrSL sl, ATerm t);
ATerm add_local_0_0 (StrSL sl, ATerm t);
static ATerm lifted2 (StrSL sl, ATerm t);
static ATerm lifted1 (StrSL sl, ATerm t);
static ATerm lifted0 (StrSL sl, ATerm t);
ATerm analyse_locality_0_0 (StrSL sl, ATerm t);
ATerm Predicate_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "Predicate_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm trm59 = t;
ATerm d_21 = NULL,e_21 = NULL,f_21 = NULL,g_21 = NULL;
if(match_cons(t, sym__2))
{
ATerm trm60 = ATgetArgument(t, 0);
if(match_cons(trm60, sym_Assign_3))
{
d_21 = ATgetArgument(trm60, 0);
e_21 = ATgetArgument(trm60, 1);
g_21 = ATgetArgument(trm60, 2);
}
else
goto label41 ;
f_21 = ATgetArgument(t, 1);
}
else
goto label41 ;
t = (ATerm) ATmakeAppl(sym_Assign_3, d_21, e_21, (ATerm) ATmakeAppl(sym_IfExp_3, f_21, g_21, term15));
goto label40 ;
label41 :
t = trm59;
{
ATerm trm61 = t;
ATerm y_20 = NULL,z_20 = NULL,a_21 = NULL,b_21 = NULL,c_21 = NULL;
if(match_cons(t, sym__2))
{
ATerm trm62 = ATgetArgument(t, 0);
if(match_cons(trm62, sym_Assign_3))
{
a_21 = ATgetArgument(trm62, 0);
b_21 = ATgetArgument(trm62, 1);
z_20 = ATgetArgument(trm62, 2);
}
else
goto label42 ;
y_20 = ATgetArgument(t, 1);
}
else
goto label42 ;
c_21 = t;
t = (ATerm) ATmakeAppl(sym__2, b_21, (ATerm) ATinsert(ATempty, term17));
t = elem_0_0(sl, t);
if((t == NULL))
goto label42 ;
t = c_21;
t = (ATerm) ATmakeAppl(sym_Assign_3, a_21, b_21, (ATerm) ATmakeAppl(sym_IfExp_3, y_20, z_20, a_21));
goto label40 ;
label42 :
t = trm61;
{
ATerm trm63 = t;
ATerm t_20 = NULL,u_20 = NULL,v_20 = NULL,w_20 = NULL,x_20 = NULL;
if(match_cons(t, sym__2))
{
ATerm trm64 = ATgetArgument(t, 0);
if(match_cons(trm64, sym_Assign_3))
{
t_20 = ATgetArgument(trm64, 0);
w_20 = ATgetArgument(trm64, 1);
v_20 = ATgetArgument(trm64, 2);
}
else
goto label43 ;
u_20 = ATgetArgument(t, 1);
}
else
goto label43 ;
x_20 = t;
t = (ATerm) ATmakeAppl(sym__2, w_20, (ATerm) ATinsert(ATinsert(ATempty, term19), term21));
t = elem_0_0(sl, t);
if((t == NULL))
goto label43 ;
t = x_20;
t = (ATerm) ATmakeAppl(sym_Assign_3, t_20, w_20, (ATerm) ATmakeAppl(sym_IfExp_3, u_20, v_20, term25));
goto label40 ;
label43 :
t = trm63;
{
ATerm o_20 = NULL,p_20 = NULL,q_20 = NULL,r_20 = NULL,s_20 = NULL;
if(match_cons(t, sym__2))
{
ATerm trm65 = ATgetArgument(t, 0);
if(match_cons(trm65, sym_Assign_3))
{
o_20 = ATgetArgument(trm65, 0);
r_20 = ATgetArgument(trm65, 1);
q_20 = ATgetArgument(trm65, 2);
}
else
goto fail21 ;
p_20 = ATgetArgument(t, 1);
}
else
goto fail21 ;
s_20 = t;
t = (ATerm) ATmakeAppl(sym__2, r_20, (ATerm) ATinsert(ATinsert(ATempty, term27), term29));
t = elem_0_0(sl, t);
if((t == NULL))
goto fail21 ;
t = s_20;
t = (ATerm) ATmakeAppl(sym_Assign_3, o_20, r_20, (ATerm) ATmakeAppl(sym_IfExp_3, p_20, q_20, term33));
goto label40 ;
}
}
}
label40 :
;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail21 :
--__tracing_table_counter;
return(NULL);
}
ATerm IfConversion_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "IfConversion_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm trm32 = t;
ATerm i_20 = NULL,j_20 = NULL,k_20 = NULL,l_20 = NULL,m_20 = NULL,n_20 = NULL;
if(match_cons(t, sym_If_2))
{
j_20 = ATgetArgument(t, 0);
i_20 = ATgetArgument(t, 1);
}
else
goto label35 ;
l_20 = t;
t = j_20;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label35 ;
t = term5;
t = newname_0_0(sl, t);
if((t == NULL))
goto label35 ;
k_20 = t;
t = l_20;
n_20 = t;
t = (ATerm) ATmakeAppl(sym__2, i_20, (ATerm) ATmakeAppl(sym_Id_1, k_20));
{
struct str_closure y_169 = { &(Predicate_0_0) , sl };
StrCL lifted22_cl = &(y_169);
t = env_alltd_1_0(sl, lifted22_cl, t);
if((t == NULL))
goto label35 ;
m_20 = t;
t = n_20;
t = (ATerm) ATmakeAppl(sym_Compound_2, (ATerm)ATinsert(ATempty, (ATerm) ATmakeAppl(sym_Declaration2_2, term9, (ATerm) ATinsert(ATempty, (ATerm) ATmakeAppl(sym_DeclInit_2, (ATerm)ATmakeAppl(sym_IdDecl_3, (ATerm)ATempty, (ATerm)ATmakeAppl(sym_Id_1, k_20), term11), (ATerm) ATmakeAppl(sym_AssignInit_1, j_20))))), (ATerm) ATinsert(ATempty, m_20));
}
goto label34 ;
label35 :
t = trm32;
{
ATerm trm33 = t;
ATerm d_20 = NULL,e_20 = NULL,f_20 = NULL,g_20 = NULL,h_20 = NULL;
if(match_cons(t, sym_If_2))
{
e_20 = ATgetArgument(t, 0);
{
ATerm trm34 = ATgetArgument(t, 1);
if(match_cons(trm34, sym_Compound_2))
{
ATerm trm35 = ATgetArgument(trm34, 0);
if(!(((ATgetType(trm35) == AT_LIST) && ATisEmpty(trm35))))
goto label36 ;
{
ATerm trm36 = ATgetArgument(trm34, 1);
if(((ATgetType(trm36) == AT_LIST) && !(ATisEmpty(trm36))))
{
ATerm trm37 = ATgetFirst((ATermList) trm36);
if(match_cons(trm37, sym_Stat_1))
{
d_20 = ATgetArgument(trm37, 0);
}
else
goto label36 ;
{
ATerm trm38 = (ATerm) ATgetNext((ATermList) trm36);
if(!(((ATgetType(trm38) == AT_LIST) && ATisEmpty(trm38))))
goto label36 ;
}
}
else
goto label36 ;
}
}
else
goto label36 ;
}
}
else
goto label36 ;
f_20 = t;
t = e_20;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label36 ;
t = f_20;
h_20 = t;
t = (ATerm) ATmakeAppl(sym__2, d_20, e_20);
{
struct str_closure z_169 = { &(Predicate_0_0) , sl };
StrCL lifted23_cl = &(z_169);
t = env_alltd_1_0(sl, lifted23_cl, t);
if((t == NULL))
goto label36 ;
g_20 = t;
t = h_20;
t = (ATerm) ATmakeAppl(sym_Stat_1, g_20);
}
goto label34 ;
label36 :
t = trm33;
{
ATerm trm39 = t;
ATerm y_19 = NULL,z_19 = NULL,a_20 = NULL,b_20 = NULL,c_20 = NULL;
if(match_cons(t, sym_If_2))
{
z_19 = ATgetArgument(t, 0);
{
ATerm trm40 = ATgetArgument(t, 1);
if(match_cons(trm40, sym_Stat_1))
{
y_19 = ATgetArgument(trm40, 0);
}
else
goto label37 ;
}
}
else
goto label37 ;
a_20 = t;
t = z_19;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label37 ;
t = a_20;
c_20 = t;
t = (ATerm) ATmakeAppl(sym__2, y_19, z_19);
{
struct str_closure a_170 = { &(Predicate_0_0) , sl };
StrCL lifted24_cl = &(a_170);
t = env_alltd_1_0(sl, lifted24_cl, t);
if((t == NULL))
goto label37 ;
b_20 = t;
t = c_20;
t = (ATerm) ATmakeAppl(sym_Stat_1, b_20);
}
goto label34 ;
label37 :
t = trm39;
{
ATerm trm41 = t;
ATerm p_19 = NULL,q_19 = NULL,r_19 = NULL,s_19 = NULL,t_19 = NULL,u_19 = NULL,w_19 = NULL,v_19 = NULL,x_19 = NULL;
if(match_cons(t, sym_IfElse_3))
{
r_19 = ATgetArgument(t, 0);
p_19 = ATgetArgument(t, 1);
q_19 = ATgetArgument(t, 2);
}
else
goto label38 ;
t_19 = t;
t = r_19;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label38 ;
t = term5;
t = newname_0_0(sl, t);
if((t == NULL))
goto label38 ;
s_19 = t;
t = t_19;
w_19 = t;
t = (ATerm) ATmakeAppl(sym__2, p_19, (ATerm) ATmakeAppl(sym_Id_1, s_19));
{
struct str_closure b_170 = { &(Predicate_0_0) , sl };
StrCL lifted25_cl = &(b_170);
t = env_alltd_1_0(sl, lifted25_cl, t);
if((t == NULL))
goto label38 ;
u_19 = t;
t = w_19;
x_19 = t;
t = (ATerm) ATmakeAppl(sym__2, q_19, (ATerm) ATmakeAppl(sym_Negation_1, (ATerm) ATmakeAppl(sym_Id_1, s_19)));
{
struct str_closure c_170 = { &(Predicate_0_0) , sl };
StrCL lifted26_cl = &(c_170);
t = env_alltd_1_0(sl, lifted26_cl, t);
if((t == NULL))
goto label38 ;
v_19 = t;
t = x_19;
t = (ATerm) ATmakeAppl(sym_Compound_2, (ATerm)ATinsert(ATempty, (ATerm) ATmakeAppl(sym_Declaration2_2, term9, (ATerm) ATinsert(ATempty, (ATerm) ATmakeAppl(sym_DeclInit_2, (ATerm)ATmakeAppl(sym_IdDecl_3, (ATerm)ATempty, (ATerm)ATmakeAppl(sym_Id_1, s_19), term11), (ATerm) ATmakeAppl(sym_AssignInit_1, r_19))))), (ATerm) ATinsert(ATinsert(ATempty, v_19), u_19));
}
}
goto label34 ;
label38 :
t = trm41;
{
ATerm trm42 = t;
ATerm j_19 = NULL,k_19 = NULL,l_19 = NULL,m_19 = NULL,n_19 = NULL,o_19 = NULL;
if(match_cons(t, sym_IfElse_3))
{
n_19 = ATgetArgument(t, 0);
{
ATerm trm43 = ATgetArgument(t, 1);
if(match_cons(trm43, sym_Compound_2))
{
ATerm trm44 = ATgetArgument(trm43, 0);
if(!(((ATgetType(trm44) == AT_LIST) && ATisEmpty(trm44))))
goto label39 ;
{
ATerm trm45 = ATgetArgument(trm43, 1);
if(((ATgetType(trm45) == AT_LIST) && !(ATisEmpty(trm45))))
{
ATerm trm46 = ATgetFirst((ATermList) trm45);
if(match_cons(trm46, sym_Stat_1))
{
ATerm trm47 = ATgetArgument(trm46, 0);
if(match_cons(trm47, sym_Assign_3))
{
j_19 = ATgetArgument(trm47, 0);
k_19 = ATgetArgument(trm47, 1);
l_19 = ATgetArgument(trm47, 2);
}
else
goto label39 ;
}
else
goto label39 ;
{
ATerm trm48 = (ATerm) ATgetNext((ATermList) trm45);
if(!(((ATgetType(trm48) == AT_LIST) && ATisEmpty(trm48))))
goto label39 ;
}
}
else
goto label39 ;
}
}
else
goto label39 ;
}
{
ATerm trm49 = ATgetArgument(t, 2);
if(match_cons(trm49, sym_Compound_2))
{
ATerm trm50 = ATgetArgument(trm49, 0);
if(!(((ATgetType(trm50) == AT_LIST) && ATisEmpty(trm50))))
goto label39 ;
{
ATerm trm51 = ATgetArgument(trm49, 1);
if(((ATgetType(trm51) == AT_LIST) && !(ATisEmpty(trm51))))
{
ATerm trm52 = ATgetFirst((ATermList) trm51);
if(match_cons(trm52, sym_Stat_1))
{
ATerm trm53 = ATgetArgument(trm52, 0);
if(match_cons(trm53, sym_Assign_3))
{
if(!((j_19 == ATgetArgument(trm53, 0))))
goto label39 ;
if(!((k_19 == ATgetArgument(trm53, 1))))
goto label39 ;
m_19 = ATgetArgument(trm53, 2);
}
else
goto label39 ;
}
else
goto label39 ;
{
ATerm trm54 = (ATerm) ATgetNext((ATermList) trm51);
if(!(((ATgetType(trm54) == AT_LIST) && ATisEmpty(trm54))))
goto label39 ;
}
}
else
goto label39 ;
}
}
else
goto label39 ;
}
}
else
goto label39 ;
o_19 = t;
t = n_19;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label39 ;
t = o_19;
t = (ATerm) ATmakeAppl(sym_Stat_1, (ATerm) ATmakeAppl(sym_Assign_3, j_19, k_19, (ATerm) ATmakeAppl(sym_IfExp_3, n_19, l_19, m_19)));
goto label34 ;
label39 :
t = trm42;
{
ATerm d_19 = NULL,e_19 = NULL,f_19 = NULL,g_19 = NULL,h_19 = NULL,i_19 = NULL;
if(match_cons(t, sym_IfElse_3))
{
h_19 = ATgetArgument(t, 0);
{
ATerm trm55 = ATgetArgument(t, 1);
if(match_cons(trm55, sym_Stat_1))
{
ATerm trm56 = ATgetArgument(trm55, 0);
if(match_cons(trm56, sym_Assign_3))
{
d_19 = ATgetArgument(trm56, 0);
e_19 = ATgetArgument(trm56, 1);
f_19 = ATgetArgument(trm56, 2);
}
else
goto fail20 ;
}
else
goto fail20 ;
}
{
ATerm trm57 = ATgetArgument(t, 2);
if(match_cons(trm57, sym_Stat_1))
{
ATerm trm58 = ATgetArgument(trm57, 0);
if(match_cons(trm58, sym_Assign_3))
{
if(!((d_19 == ATgetArgument(trm58, 0))))
goto fail20 ;
if(!((e_19 == ATgetArgument(trm58, 1))))
goto fail20 ;
g_19 = ATgetArgument(trm58, 2);
}
else
goto fail20 ;
}
else
goto fail20 ;
}
}
else
goto fail20 ;
i_19 = t;
t = h_19;
t = is_local_0_0(sl, t);
if((t == NULL))
goto fail20 ;
t = i_19;
t = (ATerm) ATmakeAppl(sym_Stat_1, (ATerm) ATmakeAppl(sym_Assign_3, d_19, e_19, (ATerm) ATmakeAppl(sym_IfExp_3, h_19, f_19, g_19)));
goto label34 ;
}
}
}
}
}
label34 :
;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail20 :
--__tracing_table_counter;
return(NULL);
}
ATerm if_conversion_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "if_conversion_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm w_18 = NULL,x_18 = NULL,y_18 = NULL,z_18 = NULL,a_19 = NULL,b_19 = NULL;
struct str_closure w_169 = { &(lifted20) , &(frame) };
StrCL lifted20_cl = &(w_169);
if(match_cons(t, sym__2))
{
w_18 = ATgetArgument(t, 0);
y_18 = ATgetArgument(t, 1);
}
else
goto fail17 ;
t = w_18;
if(match_cons(t, sym_ArrayInit_1))
{
b_19 = ATgetArgument(t, 0);
}
else
goto fail17 ;
t = b_19;
{
struct str_closure x_169 = { &(lifted19) , &(frame) };
StrCL lifted19_cl = &(x_169);
t = map_1_0(sl, lifted19_cl, t);
if((t == NULL))
goto fail17 ;
x_18 = t;
t = (ATerm) ATmakeAppl(sym__2, x_18, y_18);
t = analyse_locality_0_0(sl, t);
if((t == NULL))
goto fail17 ;
if(match_cons(t, sym__2))
{
z_18 = ATgetArgument(t, 0);
a_19 = ATgetArgument(t, 1);
}
else
goto fail17 ;
t = a_19;
t = bottomup_1_0(sl, lifted20_cl, t);
if((t == NULL))
goto fail17 ;
}
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail17 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted19 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted19";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm c_19 = NULL;
if(match_cons(t, sym_AssignInit_1))
{
ATerm trm31 = ATgetArgument(t, 0);
if(match_cons(trm31, sym_CodeConst_1))
{
c_19 = ATgetArgument(trm31, 0);
}
else
goto fail19 ;
}
else
goto fail19 ;
t = c_19;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail19 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted20 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted20";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure v_169 = { &(IfConversion_0_0) , sl_up(sl) };
StrCL lifted21_cl = &(v_169);
t = try_1_0(sl_up(sl), lifted21_cl, t);
if((t == NULL))
goto fail18 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail18 :
--__tracing_table_counter;
return(NULL);
}
ATerm main_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "main_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure u_169 = { &(if_conversion_0_0) , sl };
StrCL lifted18_cl = &(u_169);
t = io_wrap_1_0(sl, lifted18_cl, t);
if((t == NULL))
goto fail16 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail16 :
--__tracing_table_counter;
return(NULL);
}
ATerm MakeLocal_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "MakeLocal_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm trm21 = t;
ATerm s_18 = NULL,t_18 = NULL,u_18 = NULL,v_18 = NULL;
t_18 = t;
if(match_cons(t, sym_Assign_3))
{
u_18 = ATgetArgument(t, 0);
{
ATerm trm22 = ATgetArgument(t, 1);
}
s_18 = ATgetArgument(t, 2);
}
else
goto label20 ;
v_18 = t;
{
ATerm trm23 = t;
t = u_18;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label22 ;
goto label21 ;
label22 :
t = trm23;
{
ATerm a_169 = NULL;
t = u_18;
a_169 = t;
t = (ATerm) ATmakeAppl(sym__3, term1, a_169, term3);
t = table_put_0_0(sl, t);
if((t == NULL))
goto label20 ;
else
goto label21 ;
}
label21 :
;
t = v_18;
t = (ATerm) SRTS_setAnnotations(t_18, (ATerm) ATinsert(ATempty, term3));
}
goto label19 ;
label20 :
t = trm21;
{
ATerm trm24 = t;
ATerm p_18 = NULL,q_18 = NULL,r_18 = NULL;
p_18 = t;
if(match_cons(t, sym_PreIncr_1))
{
q_18 = ATgetArgument(t, 0);
}
else
goto label23 ;
r_18 = t;
{
ATerm trm25 = t;
t = q_18;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label25 ;
goto label24 ;
label25 :
t = trm25;
t = q_18;
t = add_local_0_0(sl, t);
if((t == NULL))
goto label23 ;
else
goto label24 ;
label24 :
;
t = r_18;
t = (ATerm) SRTS_setAnnotations(p_18, (ATerm) ATinsert(ATempty, term3));
}
goto label19 ;
label23 :
t = trm24;
{
ATerm trm26 = t;
ATerm m_18 = NULL,n_18 = NULL,o_18 = NULL;
m_18 = t;
if(match_cons(t, sym_PostIncr_1))
{
n_18 = ATgetArgument(t, 0);
}
else
goto label26 ;
o_18 = t;
{
ATerm trm27 = t;
t = n_18;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label28 ;
goto label27 ;
label28 :
t = trm27;
t = n_18;
t = add_local_0_0(sl, t);
if((t == NULL))
goto label26 ;
else
goto label27 ;
label27 :
;
t = o_18;
t = (ATerm) SRTS_setAnnotations(m_18, (ATerm) ATinsert(ATempty, term3));
}
goto label19 ;
label26 :
t = trm26;
{
ATerm trm28 = t;
ATerm j_18 = NULL,k_18 = NULL,l_18 = NULL;
j_18 = t;
if(match_cons(t, sym_PreDecr_1))
{
k_18 = ATgetArgument(t, 0);
}
else
goto label29 ;
l_18 = t;
{
ATerm trm29 = t;
t = k_18;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label31 ;
goto label30 ;
label31 :
t = trm29;
t = k_18;
t = add_local_0_0(sl, t);
if((t == NULL))
goto label29 ;
else
goto label30 ;
label30 :
;
t = l_18;
t = (ATerm) SRTS_setAnnotations(j_18, (ATerm) ATinsert(ATempty, term3));
}
goto label19 ;
label29 :
t = trm28;
{
ATerm g_18 = NULL,h_18 = NULL,i_18 = NULL;
g_18 = t;
if(match_cons(t, sym_PostDecr_1))
{
h_18 = ATgetArgument(t, 0);
}
else
goto fail15 ;
i_18 = t;
{
ATerm trm30 = t;
t = h_18;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label33 ;
goto label32 ;
label33 :
t = trm30;
t = h_18;
t = add_local_0_0(sl, t);
if((t == NULL))
goto fail15 ;
else
goto label32 ;
label32 :
;
t = i_18;
t = (ATerm) SRTS_setAnnotations(g_18, (ATerm) ATinsert(ATempty, term3));
goto label19 ;
}
}
}
}
}
label19 :
;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail15 :
--__tracing_table_counter;
return(NULL);
}
ATerm AnalyseLocality_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "AnalyseLocality_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm trm7 = t;
ATerm c_18 = NULL,d_18 = NULL,e_18 = NULL,f_18 = NULL;
c_18 = t;
if(match_cons(t, sym_If_2))
{
d_18 = ATgetArgument(t, 0);
e_18 = ATgetArgument(t, 1);
}
else
goto label5 ;
f_18 = t;
t = d_18;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label5 ;
t = e_18;
{
struct str_closure h_169 = { &(lifted4) , &(frame) };
StrCL lifted4_cl = &(h_169);
t = bottomup_1_0(sl, lifted4_cl, t);
if((t == NULL))
goto label5 ;
t = f_18;
t = (ATerm) SRTS_setAnnotations(c_18, (ATerm) ATinsert(ATempty, term3));
}
goto label4 ;
label5 :
t = trm7;
{
ATerm trm8 = t;
ATerm x_17 = NULL,y_17 = NULL,z_17 = NULL,a_18 = NULL,b_18 = NULL;
x_17 = t;
if(match_cons(t, sym_IfElse_3))
{
y_17 = ATgetArgument(t, 0);
z_17 = ATgetArgument(t, 1);
a_18 = ATgetArgument(t, 2);
}
else
goto label6 ;
b_18 = t;
t = y_17;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label6 ;
t = z_17;
{
struct str_closure j_169 = { &(lifted6) , &(frame) };
StrCL lifted6_cl = &(j_169);
t = bottomup_1_0(sl, lifted6_cl, t);
if((t == NULL))
goto label6 ;
t = a_18;
{
struct str_closure l_169 = { &(lifted8) , &(frame) };
StrCL lifted8_cl = &(l_169);
t = bottomup_1_0(sl, lifted8_cl, t);
if((t == NULL))
goto label6 ;
t = b_18;
t = (ATerm) SRTS_setAnnotations(x_17, (ATerm) ATinsert(ATempty, term3));
}
}
goto label4 ;
label6 :
t = trm8;
{
ATerm trm9 = t;
ATerm t_17 = NULL,u_17 = NULL,v_17 = NULL,w_17 = NULL;
t_17 = t;
if(match_cons(t, sym_While_2))
{
u_17 = ATgetArgument(t, 0);
v_17 = ATgetArgument(t, 1);
}
else
goto label7 ;
w_17 = t;
t = u_17;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label7 ;
t = v_17;
{
struct str_closure n_169 = { &(lifted10) , &(frame) };
StrCL lifted10_cl = &(n_169);
t = bottomup_1_0(sl, lifted10_cl, t);
if((t == NULL))
goto label7 ;
t = w_17;
t = (ATerm) SRTS_setAnnotations(t_17, (ATerm) ATinsert(ATempty, term3));
}
goto label4 ;
label7 :
t = trm9;
{
ATerm trm10 = t;
ATerm p_17 = NULL,q_17 = NULL,r_17 = NULL,s_17 = NULL;
p_17 = t;
if(match_cons(t, sym_DoWhile_2))
{
q_17 = ATgetArgument(t, 0);
r_17 = ATgetArgument(t, 1);
}
else
goto label8 ;
s_17 = t;
t = q_17;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label8 ;
t = r_17;
{
struct str_closure p_169 = { &(lifted12) , &(frame) };
StrCL lifted12_cl = &(p_169);
t = bottomup_1_0(sl, lifted12_cl, t);
if((t == NULL))
goto label8 ;
t = s_17;
t = (ATerm) SRTS_setAnnotations(p_17, (ATerm) ATinsert(ATempty, term3));
}
goto label4 ;
label8 :
t = trm10;
{
ATerm trm11 = t;
ATerm j_17 = NULL,k_17 = NULL,l_17 = NULL,m_17 = NULL,n_17 = NULL,o_17 = NULL;
k_17 = t;
if(match_cons(t, sym_For_4))
{
j_17 = ATgetArgument(t, 0);
l_17 = ATgetArgument(t, 1);
m_17 = ATgetArgument(t, 2);
n_17 = ATgetArgument(t, 3);
}
else
goto label9 ;
o_17 = t;
t = l_17;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label9 ;
t = m_17;
{
struct str_closure r_169 = { &(lifted14) , &(frame) };
StrCL lifted14_cl = &(r_169);
t = bottomup_1_0(sl, lifted14_cl, t);
if((t == NULL))
goto label9 ;
t = n_17;
{
struct str_closure t_169 = { &(lifted16) , &(frame) };
StrCL lifted16_cl = &(t_169);
t = bottomup_1_0(sl, lifted16_cl, t);
if((t == NULL))
goto label9 ;
t = o_17;
t = (ATerm) SRTS_setAnnotations(k_17, (ATerm) ATinsert(ATempty, term3));
}
}
goto label4 ;
label9 :
t = trm11;
{
ATerm trm12 = t;
ATerm f_17 = NULL,g_17 = NULL,h_17 = NULL,i_17 = NULL;
f_17 = t;
if(match_cons(t, sym_Assign_3))
{
h_17 = ATgetArgument(t, 0);
{
ATerm trm13 = ATgetArgument(t, 1);
}
g_17 = ATgetArgument(t, 2);
}
else
goto label10 ;
i_17 = t;
{
ATerm trm14 = t;
t = h_17;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label12 ;
goto label11 ;
label12 :
t = trm14;
t = g_17;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label10 ;
else
goto label11 ;
label11 :
;
{
ATerm trm15 = t;
t = h_17;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label14 ;
goto label13 ;
label14 :
t = trm15;
{
ATerm z_168 = NULL;
t = h_17;
z_168 = t;
t = (ATerm) ATmakeAppl(sym__3, term1, z_168, term3);
t = table_put_0_0(sl, t);
if((t == NULL))
goto label10 ;
else
goto label13 ;
}
label13 :
;
t = i_17;
t = (ATerm) SRTS_setAnnotations(f_17, (ATerm) ATinsert(ATempty, term3));
}
}
goto label4 ;
label10 :
t = trm12;
{
ATerm b_17 = NULL,c_17 = NULL,d_17 = NULL,e_17 = NULL;
b_17 = t;
if(match_cons(t, sym_DeclInit_2))
{
ATerm trm16 = ATgetArgument(t, 0);
if(match_cons(trm16, sym_IdDecl_3))
{
ATerm trm17 = ATgetArgument(trm16, 0);
d_17 = ATgetArgument(trm16, 1);
{
ATerm trm18 = ATgetArgument(trm16, 2);
}
}
else
goto fail7 ;
c_17 = ATgetArgument(t, 1);
}
else
goto fail7 ;
e_17 = t;
{
ATerm trm19 = t;
t = d_17;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label16 ;
goto label15 ;
label16 :
t = trm19;
t = c_17;
t = is_local_0_0(sl, t);
if((t == NULL))
goto fail7 ;
else
goto label15 ;
label15 :
;
{
ATerm trm20 = t;
t = d_17;
t = is_local_0_0(sl, t);
if((t == NULL))
goto label18 ;
goto label17 ;
label18 :
t = trm20;
t = d_17;
t = add_local_0_0(sl, t);
if((t == NULL))
goto fail7 ;
else
goto label17 ;
label17 :
;
t = e_17;
t = (ATerm) SRTS_setAnnotations(b_17, (ATerm) ATinsert(ATempty, term3));
goto label4 ;
}
}
}
}
}
}
}
}
label4 :
;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail7 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted16 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted16";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure s_169 = { &(MakeLocal_0_0) , sl_up(sl) };
StrCL lifted17_cl = &(s_169);
t = try_1_0(sl_up(sl), lifted17_cl, t);
if((t == NULL))
goto fail14 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail14 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted14 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted14";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure q_169 = { &(MakeLocal_0_0) , sl_up(sl) };
StrCL lifted15_cl = &(q_169);
t = try_1_0(sl_up(sl), lifted15_cl, t);
if((t == NULL))
goto fail13 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail13 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted12 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted12";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure o_169 = { &(MakeLocal_0_0) , sl_up(sl) };
StrCL lifted13_cl = &(o_169);
t = try_1_0(sl_up(sl), lifted13_cl, t);
if((t == NULL))
goto fail12 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail12 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted10 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted10";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure m_169 = { &(MakeLocal_0_0) , sl_up(sl) };
StrCL lifted11_cl = &(m_169);
t = try_1_0(sl_up(sl), lifted11_cl, t);
if((t == NULL))
goto fail11 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail11 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted8 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted8";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure k_169 = { &(MakeLocal_0_0) , sl_up(sl) };
StrCL lifted9_cl = &(k_169);
t = try_1_0(sl_up(sl), lifted9_cl, t);
if((t == NULL))
goto fail10 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail10 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted6 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted6";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure i_169 = { &(MakeLocal_0_0) , sl_up(sl) };
StrCL lifted7_cl = &(i_169);
t = try_1_0(sl_up(sl), lifted7_cl, t);
if((t == NULL))
goto fail9 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail9 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted4 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted4";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure f_169 = { &(MakeLocal_0_0) , sl_up(sl) };
StrCL lifted5_cl = &(f_169);
t = try_1_0(sl_up(sl), lifted5_cl, t);
if((t == NULL))
goto fail8 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail8 :
--__tracing_table_counter;
return(NULL);
}
ATerm AnalyseLocality_p__0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "AnalyseLocality_p__0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm x_16 = NULL,y_16 = NULL,z_16 = NULL,a_17 = NULL;
y_16 = t;
{
ATerm trm5,trm6;
trm5 = SSL_get_constructor(t);
trm6 = SSL_get_arguments(t);
x_16 = trm5;
z_16 = trm6;
}
a_17 = t;
t = z_16;
{
struct str_closure e_169 = { &(is_local_0_0) , sl };
StrCL lifted3_cl = &(e_169);
t = fetch_elem_1_0(sl, lifted3_cl, t);
if((t == NULL))
goto fail6 ;
t = a_17;
t = (ATerm) SRTS_setAnnotations(y_16, (ATerm) ATinsert(ATempty, term3));
}
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail6 :
--__tracing_table_counter;
return(NULL);
}
ATerm is_local_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "is_local_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm v_16 = NULL,w_16 = NULL;
ATerm trm1 = t;
v_16 = t;
t = (ATerm) ATmakeAppl(sym__2, term1, v_16);
t = table_get_0_0(sl, t);
if((t == NULL))
goto label3 ;
goto label2 ;
label3 :
t = trm1;
{
ATerm trm2;
trm2 = (ATerm) ATgetAnnotations(t);
if((trm2 == NULL))
trm2 = (ATerm) ATempty;
w_16 = t;
if(((ATgetType(trm2) == AT_LIST) && !(ATisEmpty(trm2))))
{
ATerm trm3 = ATgetFirst((ATermList) trm2);
if(!((ATgetSymbol(trm3) == ATmakeSymbol("local", 0, ATtrue))))
goto fail5 ;
{
ATerm trm4 = (ATerm) ATgetNext((ATermList) trm2);
if(!(((ATgetType(trm4) == AT_LIST) && ATisEmpty(trm4))))
goto fail5 ;
}
goto label2 ;
}
else
goto fail5 ;
}
label2 :
;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail5 :
--__tracing_table_counter;
return(NULL);
}
ATerm add_local_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "add_local_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm u_16 = NULL;
u_16 = t;
t = (ATerm) ATmakeAppl(sym__3, term1, u_16, term3);
t = table_put_0_0(sl, t);
if((t == NULL))
goto fail4 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail4 :
--__tracing_table_counter;
return(NULL);
}
ATerm analyse_locality_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "analyse_locality_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm q_16 = NULL,r_16 = NULL,s_16 = NULL,t_16 = NULL;
if(match_cons(t, sym__2))
{
q_16 = ATgetArgument(t, 0);
r_16 = ATgetArgument(t, 1);
}
else
goto fail0 ;
t = term1;
t = table_create_0_0(sl, t);
if((t == NULL))
goto fail0 ;
t = q_16;
{
struct str_closure b_169 = { &(lifted0) , &(frame) };
StrCL lifted0_cl = &(b_169);
t = map_1_0(sl, lifted0_cl, t);
if((t == NULL))
goto fail0 ;
t = r_16;
{
struct str_closure d_169 = { &(lifted1) , &(frame) };
StrCL lifted1_cl = &(d_169);
t = bottomup_1_0(sl, lifted1_cl, t);
if((t == NULL))
goto fail0 ;
t_16 = t;
t = term1;
t = table_keys_0_0(sl, t);
if((t == NULL))
goto fail0 ;
s_16 = t;
t = (ATerm) ATmakeAppl(sym__2, s_16, t_16);
}
}
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail0 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted1 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted1";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure c_169 = { &(lifted2) , &(frame) };
StrCL lifted2_cl = &(c_169);
t = try_1_0(sl_up(sl), lifted2_cl, t);
if((t == NULL))
goto fail2 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail2 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted2 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted2";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm trm0 = t;
t = AnalyseLocality_0_0(sl_up(sl_up(sl)), t);
if((t == NULL))
goto label1 ;
goto label0 ;
label1 :
t = trm0;
t = AnalyseLocality_p__0_0(sl_up(sl_up(sl)), t);
if((t == NULL))
goto fail3 ;
else
goto label0 ;
label0 :
;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail3 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm y_168 = NULL;
y_168 = t;
t = (ATerm) ATmakeAppl(sym__3, term1, y_168, term3);
t = table_put_0_0(sl_up(sl), t);
if((t == NULL))
goto fail1 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail1 :
--__tracing_table_counter;
return(NULL);
}
static void register_strategies (void)
{
int initial_size = 117;
int max_load = 75;
struct str_closure * closures;
int closures_index = 0;
if((strategy_table == NULL))
strategy_table = ATtableCreate(initial_size, max_load);
closures = (struct str_closure*) malloc((sizeof(struct str_closure) * 34));
if((closures == NULL))
{
perror("malloc error for registration of dynamic strategies");
exit(1);
}
closures[closures_index].fun = &(table_keys_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("table_keys_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(table_get_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("table_get_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(table_put_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("table_put_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(table_create_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("table_create_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(fetch_elem_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("fetch_elem_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(elem_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("elem_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(map_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("map_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(try_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("try_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(bottomup_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("bottomup_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(env_alltd_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("env_alltd_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(newname_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("newname_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(io_wrap_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("io_wrap_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(Predicate_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("Predicate_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(IfConversion_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("IfConversion_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted19);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted19", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted20);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted20", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(if_conversion_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("if_conversion_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(main_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("main_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(MakeLocal_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("MakeLocal_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted16);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted16", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted14);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted14", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted12);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted12", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted10);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted10", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted8);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted8", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted6);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted6", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted4);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted4", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(AnalyseLocality_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("AnalyseLocality_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(AnalyseLocality_p__0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("AnalyseLocality_p__0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(is_local_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("is_local_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(add_local_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("add_local_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted2);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted2", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted1);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted1", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(analyse_locality_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("analyse_locality_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
}
int main (int argc, char * argv [])
{
ATerm out_term;
ATermList in_term;
int i;
ATinit(argc, argv, &(out_term));
init_constructors();
in_term = ATempty;
for ( i = (argc - 1) ; (i >= 0) ; i-- )
{
in_term = ATinsert(in_term, (ATerm) ATmakeAppl0(ATmakeSymbol(argv[i], 0, ATtrue)));
}
SRTS_stratego_initialize();
memset(__tracing_table, 0, (sizeof(unsigned short) * TRACING_TABLE_SIZE));
__tracing_table_counter = 0;
register_strategies();
out_term = main_0_0(NULL, (ATerm) in_term);
if((out_term != NULL))
{
ATfprintf(stdout, "%t\n", out_term);
exit(0);
}
else
{
ATfprintf(stderr, "%s: rewriting failed, trace:\n", argv[0]);
for ( i = 0 ; (__tracing_table[i] && (i < TRACING_TABLE_SIZE)) ; i++ )
ATfprintf(stderr, "\t%s\n", __tracing_table[i]);
exit(1);
}
}
